package com.test.designpattern.chainOfResponsibility.demo2;

import org.springframework.stereotype.Component;

@Component
public class OptHandler1 implements IOptHandler {
    @Override
    public Integer getOrder() {
        return 1;
    }

    @Override
    public void handle(Object obj, OptHandlerChain chain) {
        System.out.println("执行业务：OptHandler1，参数：" + obj.toString());
        // 调用OptHandlerChain的方法，此时index已经+1，相当与执行下一个执行器
        chain.process(obj);
    }
}
